/*
 * @Author: doinb
 * @Date: 2019-05-09 16:18:12
 * @LastEditTime: 2019-08-31 16:01:52
 */
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
const _import = require('./_import_' + process.env.NODE_ENV)
export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
       redirect: '/Home'
    },
    {
      path: '/Home',
      name: 'Home',
      component: _import('Home/index'),
      meta:{
        index: 0,
      }
    },
    // {
    //   path: '/Product',
    //   name: 'product',
    //   component: _import('Product/index'),
    //   meta: {
    //     index: 1,
    //   }
    // },
    // {
    //   path: '/Core',
    //   name: 'Core',
    //   component: _import('Core/index'),
    //   meta: {
    //     index: 2,
    //   }
    // },
    {
      path: '/Paper',
      name: 'Paper',
      component: _import('Paper/index'),
      meta: {
        index: 3,
      }
    },
    // {
    //   path: '/Company',
    //   name: 'Company',
    //   component: _import('Company/index'),
    //   meta: {
    //     index: 4,
    //   }
    // },
    {
      path: '/Contact',
      name: 'Contact',
      component: _import('Contact/index'),
      meta: {
        index: 5,
      }
    }
  ],
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return {
        x: 0,
        y: 0
      }
    }
  },
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return {
        x: 0,
        y: 0
      }
    }
  }
})


